<?xml version="1.0" encoding="UTF-8" ?>
<!--
<product>
   <id>1</id>
   <name>this is name</name>
   <description>this is description</description>
</product>
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html"/>
    <xsl:template match="productlist">
        <table  border="1" class="right_content">
            <tr><td colspan="5" class="content_head">Item List</td></tr>
            <tr>
                <td>
                    <strong>Item Name</strong>
                </td>
                <td colspan="4">
                    <strong>Description</strong>
                </td>
                
            </tr>
            <xsl:apply-templates/>
        </table>
    </xsl:template>
    <xsl:template match="product">
        <form action="Shop" method="get">
            <tr>
                <td>
            <xsl:element name="a">
                <xsl:attribute name="href"><xsl:text disable-output-escaping="yes"><![CDATA[Shop?action=detail&product_id=]]></xsl:text><xsl:value-of select="id"/></xsl:attribute>
                <xsl:attribute name="title">Click here to view details</xsl:attribute>
                <xsl:text><xsl:value-of select="name"/></xsl:text>
            </xsl:element>
            </td>
            <td>
            <xsl:value-of select="description"/>
            </td>
            <td colspan="3">
            <xsl:element name="input">
                <xsl:attribute name="name">quantity</xsl:attribute>
                <xsl:attribute name="type">text</xsl:attribute>
                <xsl:attribute name="value">1</xsl:attribute>
            </xsl:element>
            
            <xsl:element name="input">
                <xsl:attribute name="name">submit</xsl:attribute>
                <xsl:attribute name="type">submit</xsl:attribute>
                <xsl:attribute name="value">Select</xsl:attribute>
            </xsl:element>
            
            <xsl:element name="input">
                <xsl:attribute name="name">id</xsl:attribute>
                <xsl:attribute name="type">hidden</xsl:attribute>
                <xsl:attribute name="value"><xsl:value-of select="id"/></xsl:attribute>
            </xsl:element>
            
            <xsl:element name="input">
                <xsl:attribute name="name">action</xsl:attribute>
                <xsl:attribute name="type">hidden</xsl:attribute>
                <xsl:attribute name="value">add</xsl:attribute>
            </xsl:element>
            </td>
            </tr>

        </form>
    </xsl:template>
</xsl:stylesheet>

